/*
 * @(#)MaintMtmWfStepNotificationRuleForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.workflow.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;
import com.dcivision.workflow.bean.MtmWfStepNotificationRule;

/**
  MaintMtmWfStepNotificationRuleForm.java

  This class is the for web form purpose.

  @author      Dick Xie
  @company     DCIVision Limited
  @creation date   07/12/2004
  @version     $Revision: 1.2 $
*/

public class MaintMtmWfStepNotificationRuleForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.2 $";

  private String workflowStepID = null;
  private String notifyTrigger = null;
  private String notifyAtField = null;
  private String notifyAtAmt = null;
  private String notifyAckMethod = null;
  private String notifyAckMethodByEmail = null;
  private String notifyAckMethodBySystem = null;
  public MaintMtmWfStepNotificationRuleForm() {
    super();
  }

  public String getWorkflowStepID() { 
    return(this.workflowStepID);
  }

  public void setWorkflowStepID(String workflowStepID) { 
    this.workflowStepID = workflowStepID;
  }

  public String getNotifyTrigger() { 
    return(this.notifyTrigger);
  }

  public void setNotifyTrigger(String notifyTrigger) { 
    this.notifyTrigger = notifyTrigger;
  }

  public String getNotifyAtField() { 
    return(this.notifyAtField);
  }

  public void setNotifyAtField(String notifyAtField) { 
    this.notifyAtField = notifyAtField;
  }

  public String getNotifyAtAmt() { 
    return(this.notifyAtAmt);
  }

  public void setNotifyAtAmt(String notifyAtAmt) { 
    this.notifyAtAmt = notifyAtAmt;
  }

  public String getNotifyAckMethod() { 
    return(this.notifyAckMethod);
  }

  public void setNotifyAckMethod(String notifyAckMethod) { 
    this.notifyAckMethod = notifyAckMethod;
  }
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setWorkflowStepID(null);
    this.setNotifyTrigger(null);
    this.setNotifyAtField(null);
    this.setNotifyAtAmt(null);
    this.setNotifyAckMethod(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    MtmWfStepNotificationRule tmpMtmWfStepNotificationRule = new MtmWfStepNotificationRule();
    tmpMtmWfStepNotificationRule.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpMtmWfStepNotificationRule.setWorkflowStepID(TextUtility.parseIntegerObj(this.getWorkflowStepID()));
    tmpMtmWfStepNotificationRule.setNotifyTrigger(this.getNotifyTrigger());
    tmpMtmWfStepNotificationRule.setNotifyAtField(TextUtility.parseIntegerObj(this.getNotifyAtField()));
    tmpMtmWfStepNotificationRule.setNotifyAtAmt(TextUtility.parseIntegerObj(this.getNotifyAtAmt()));
    tmpMtmWfStepNotificationRule.setNotifyAckMethod(this.getNotifyAckMethod());
    tmpMtmWfStepNotificationRule.setRecordStatus(this.getRecordStatus());
    tmpMtmWfStepNotificationRule.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpMtmWfStepNotificationRule.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpMtmWfStepNotificationRule.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpMtmWfStepNotificationRule.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpMtmWfStepNotificationRule.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpMtmWfStepNotificationRule;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    MtmWfStepNotificationRule tmpMtmWfStepNotificationRule = (MtmWfStepNotificationRule)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpMtmWfStepNotificationRule.getID()));
    this.setWorkflowStepID(TextUtility.formatIntegerObj(tmpMtmWfStepNotificationRule.getWorkflowStepID()));
    this.setNotifyTrigger(tmpMtmWfStepNotificationRule.getNotifyTrigger());
    this.setNotifyAtField(TextUtility.formatIntegerObj(tmpMtmWfStepNotificationRule.getNotifyAtField()));
    this.setNotifyAtAmt(TextUtility.formatIntegerObj(tmpMtmWfStepNotificationRule.getNotifyAtAmt()));
    this.setNotifyAckMethod(tmpMtmWfStepNotificationRule.getNotifyAckMethod());
    this.setRecordStatus(tmpMtmWfStepNotificationRule.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpMtmWfStepNotificationRule.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpMtmWfStepNotificationRule.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpMtmWfStepNotificationRule.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpMtmWfStepNotificationRule.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpMtmWfStepNotificationRule.getUpdateDate()));
  }
/**
 * @return Returns the notifyAckMethodByEmail.
 */
public String getNotifyAckMethodByEmail() {
	return notifyAckMethodByEmail;
}
/**
 * @param notifyAckMethodByEmail The notifyAckMethodByEmail to set.
 */
public void setNotifyAckMethodByEmail(String notifyAckMethodByEmail) {
	this.notifyAckMethodByEmail = notifyAckMethodByEmail;
}
/**
 * @return Returns the notifyAckMethodBySystem.
 */
public String getNotifyAckMethodBySystem() {
	return notifyAckMethodBySystem;
}
/**
 * @param notifyAckMethodBySystem The notifyAckMethodBySystem to set.
 */
public void setNotifyAckMethodBySystem(String notifyAckMethodBySystem) {
	this.notifyAckMethodBySystem = notifyAckMethodBySystem;
}
}
